﻿using System;

namespace Creventive.Wpf.ShellFactory.Workspace
{
    /// <summary>
    /// Registers the given view model type to the given view type.
    /// </summary>
    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)]
    public class ApplicationViewModelAttribute : Attribute
    {
        private Type viewType;
        private Type viewModelType;

        /// <summary>
        /// Initializes a new instance of the <see cref="ApplicationViewModelAttribute"/> class.
        /// </summary>
        /// <param name="viewModelType">Type of the view model.</param>
        /// <param name="viewType">Type of the view.</param>
        public ApplicationViewModelAttribute(Type viewModelType, Type viewType)
        {
            this.viewType = viewType;
            this.viewModelType = viewModelType;
        }

        /// <summary>
        /// Gets the type of the view.
        /// </summary>
        /// <value>The type of the view.</value>
        public Type ViewType
        {
            get { return this.viewType; }
        }

        /// <summary>
        /// Gets the type of the view model.
        /// </summary>
        /// <value>The type of the view model.</value>
        public Type ViewModelType
        {
            get { return this.viewModelType; }
        }
    }
}